package com.ph.config;

import com.ph.interceptor.LoginInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
/**
 * 
* @ClassName: WebCofig  
* @Description:web config  
* @author tony  
* @date 2017年3月29日  
*
 */
@Configuration
public class WebCofig extends WebMvcConfigurerAdapter{

	/**
	 * 需要拦截的请求配置（备注，需要添加的直接在数组里面添加）
	 */
    private static final String[] pathPatterns = {"/account/**", "/bankcard/**", "/personal/**", "/score/**", "/shopping/order/**",
            "/address/**" };

	@Override
	public void addInterceptors(InterceptorRegistry registry) {
		registry.addInterceptor(new LoginInterceptor()).addPathPatterns(pathPatterns);
	}
}
